function unauthorized(res) {
    if (res !== null && res !== "") {
        if (res.code === 401 || res.code === "401") {
            location.href = "/oa/error/401";
        } else if (res.code === 403 || res.code === "403") {
            location.href = "/oa/error/403";
        }
    }
}

function unauthorized_2(authorities, target) {
    if (authorities === null ||
        authorities === "" ||
        authorities.indexOf(target) < 0) {
        location.href = "/oa/error/403";
    }
}

function getCookie(name) {
    let strcookie = document.cookie;//获取cookie字符串
    let arrcookie = strcookie.split("; ");//分割
    //遍历匹配
    for (let i = 0; i < arrcookie.length; i++) {
        let arr = arrcookie[i].split("=");
        if (arr[0] === name) {
            return arr[1];
        }
    }
    return "";
}
